import json
import grpc

from robot_python.grpc import robot_pb2
from robot_python.grpc import robot_pb2_grpc

if __name__ == '__main__':
    channel = grpc.insecure_channel("localhost:50051")
    stub = robot_pb2_grpc.RobotServiceStub(channel)
    print(stub.HelloWorld(robot_pb2.Request(data=json.dumps(666))).data)
    print(stub.HelloWorld(robot_pb2.Request(data=json.dumps("world"))).data)
    print(stub.HelloWorld(robot_pb2.Request(data=json.dumps({"name": "hello", "age": 6}))).data)
